/*
 * @Author: 黄达全
 * @Date: 2024-08-11 19:57:25
 * @LastEditTime: 2024-08-11 20:26:00
 */
import axios from "../index"
import type { RuleApi, ApiResponse,AccessItem } from "@/common/type"


export default {
    //获取全部权限
    async select() {
        return (await axios.get("/admin/rule")).data as ApiResponse<AccessItem[]>
    },
    // 新增权限
    async add(form) {
        return (await axios.post("/admin/rule", form)).data as ApiResponse<null>
    },

    // 删除权限
    async delete(id) {
        return (await axios.delete(`/admin/rule/${id}`)).data as ApiResponse<null>
    },
    // 编辑权限
    async edit(id,form) {
        return (await axios.put("/admin/rule/"+id, form)).data as ApiResponse<null>
    }

} as RuleApi